<extend name='./Base' />
<block name="css">
<link rel="stylesheet" href="__PUBLIC__/static/highlightJS/styles/<?php echo !isset(F('webSet')['codestyle'])?'solarized_dark':F('webSet')['codestyle'];?>.css">
<link rel="stylesheet" href="__PUBLIC__/static/admin/tags/jquery.tagsinput.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/static/admin/colpick/colpick.css">
</block>
<block name='admin-content-body'>
<div class="admin-content-body">
      <div class="am-cf am-padding am-padding-bottom-0">
        <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">网站设置</strong> / <small>Setting</small></div>
      </div>

      <hr>

      <div class="am-g">
        <div class="am-u-sm-12">
          <form class="am-form" method="post" id="setForm">
            <div class="am-g am-margin-top">
              <div class="am-u-sm-4 am-u-md-2 am-text-right">
                站点名称
              </div>
              <div class="am-u-sm-8 am-u-md-4">
                <input type="text" class="am-input-sm" name="webtitle" id="webtitle" value="{:F('webSet')['webtitle']}">
              </div>
              <div class="am-hide-sm-only am-u-md-6">*必填</div>
            </div>

            <div class="am-g am-margin-top">
              <div class="am-u-sm-4 am-u-md-2 am-text-right">
                代码高亮
              </div>
              <div class="am-u-sm-8 am-u-md-4 am-u-end">
              <div id="selectHtml"></div>
              </div>

              <div class="am-hide-sm-only am-u-md-6">选填</div>
            </div>
              <div class="am-g am-margin-top">
              <div class="am-u-sm-4 am-u-md-2 am-text-right">
                代码高亮示例
              </div>
              <div class="am-u-sm-8 am-u-md-7 am-u-end">
              <div class="am-tabs" data-am-tabs>
  <ul class="am-tabs-nav am-nav am-nav-tabs">
    <li class="am-active"><a href="#tab1">PHP</a></li>
    <li><a href="#tab2">HTML</a></li>
    <li><a href="#tab9">CSS</a></li>
    <li><a href="#tab3">Python</a></li>
    <li><a href="#tab5">JavaScript</a></li>
    <li><a href="#tab7">SQL</a></li>
  </ul>

  <div class="am-tabs-bd">
    <div class="am-tab-panel am-fade am-in am-active" id="tab1">
<pre class="precode"><code class="php">
class Test {  
    private $name;  
    private $age;  
    private $sex;  
    public function __construct($array) {  
        $this->name = $array['name'];  
        $this->age = $array['age'];  
        $this->sex = $array['sex'];  
    } 
    public function show() {  
        printf('my name is %s',$this->name);  
    }  
}  
</code></pre>  
    </div>
    <div class="am-tab-panel am-fade" id="tab2">
<pre class="precode"><code class="html">
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;title&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;p&gt;青春啊，永远是美好的，只属于这些永远力争上游的人&lt;/p&gt;
    &lt;span style=&quot;background-color: red;&quot;&gt;永远忘我劳动的人&lt;/span&gt;
    &lt;footer class=&quot;admin-content-footer&quot;&gt;
        &lt;hr&gt;&lt;p class=&quot;am-padding-left&quot;&gt;BaAGee&lt;/p&gt;
    &lt;/footer&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
    </div>
    <div class="am-tab-panel am-fade" id="tab3">
<pre class="precode"><code class="python">
#!/usr/bin/python
# -*- coding: UTF-8 -*-

i = int(raw_input('净利润:'))
arr = [1000000,600000,400000,200000,100000,0]
rat = [0.01,0.015,0.03,0.05,0.075,0.1]
r = 0
for idx in range(0,6):
    if i>arr[idx]:
        r+=(i-arr[idx])*rat[idx]
        print (i-arr[idx])*rat[idx]
        i=arr[idx]
print r
</code></pre>
    </div>

    <div class="am-tab-panel am-fade" id="tab5">
<pre class="precode"><code class="javascript">
alert('began');
var sum=0;
for(var i=1;i&lt;5;i++){
    for(var j=1;j&lt;5;j++){
        for(var k=1;k&lt;5;k++){
            if(i!=k&&k!=j&&i!=j){
                sum++;
                console.log(''+i+k+j);
            }
        }
    }
}
console.log(sum);
</code></pre>
    </div>

            <div class="am-tab-panel am-fade" id="tab7">
<pre class="precode"><code class="sql">
CREATE DATABASE mytest
USE mytest
CREATE TABLE userInfo(
    userId INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
    userSex INT(4) DEFAULT '0', #性别默认为0
    userAges DOUBLE(10,2) NOT NULL, #工资为double类型
    userName VARCHAR(20) NOT NULL,
    userPwd VARCHAR(20) NOT NULL
);
INSERT INTO userInfo VALUES('',0,2000,'张三','123456');
UPDATE userInfo SET userWages=4500 WHERE userId=2;
ALTER TABLE userInfo ADD userAge INT(100);
ALTER TABLE userInfo CHANGE userSex userSexs INT;
</code></pre>
    </div>

<div class="am-tab-panel am-fade" id="tab9">
<pre class="precode"><code class="css">
.current{
    z-index: 2;
    color: #fff;
    background-color: #0e90d2;
    border-color: #0e90d2;
    cursor: default;
    border: 1px solid #ddd;
    border-radius: 0;
    margin-bottom: 5px;
    padding: .4em .4em;
    text-decoration: none;
    line-height: 1.2;
}
</code></pre>
    </div>
  </div> 
</div>
              </div>
              </div>
            <div class="am-g am-margin-top">
              <div class="am-u-sm-4 am-u-md-2 am-text-right" style="line-height: 60px">
                图片水印
              </div>
              <div class="am-u-sm-8 am-u-md-4">
              <span>文字:</span>
                <input type="text" class="am-input-sm" name="picwater" id="picwater" value="{:F('webSet')['picwater']}" placeholder="水印文字">
              </div>
              <div class="am-u-sm-8 am-u-md-2">水印大小:(<span style="font-size: <?php echo !isset(F('webSet')['picwaterfontsize'])?15:F('webSet')['picwaterfontsize'];?>px" id="suchas">示例大小</span>)
                <input type="number" class="am-input-sm" max="20" min="10" name="picwaterfontsize" id="picwaterfontsize" value="{:F('webSet')['picwaterfontsize']}" placeholder="水印文字大小(推荐最大不超过20的整数)" onchange="updatesuch(this)">
              </div>
              <div class="am-u-sm-8 am-u-md-2">水印颜色:
                <input type="text" class="am-input-sm" name="picwaterfontcolor" id="picwaterfontcolor" value="{:F('webSet')['picwaterfontcolor']}" placeholder="水印文字颜色" readonly="readonly">
              </div>
              <div class="am-hide-sm-only am-u-md-2">不填则没有水印</div>
            </div>

            <div class="am-g am-margin-top">
              <div class="am-u-sm-4 am-u-md-2 am-text-right">
                站点关键字
              </div>
              <div class="am-u-sm-8 am-u-md-8">
                <input type="text" class="am-input-sm" name="keywords" id="keywords" value="{:F('webSet')['keywords']}">
              </div>
              <div class="am-hide-sm-only am-u-md-2">*必填</div>
            </div>

            <div class="am-g am-margin-top-sm">
              <div class="am-u-sm-12 am-u-md-2 am-text-right admin-form-text">
                站点描述
              </div>
              <div class="am-u-sm-8 am-u-md-8">
                <textarea id="web_description" name="web_description"  rows="7">{:F('webSet')['web_description']}</textarea>
              </div>
              <div class="am-hide-sm-only am-u-md-2">*必填</div>
            </div>
            <div class="am-g am-margin-top">
              <div class="am-u-sm-4 am-u-md-2 am-text-right">
                网站版权信息
              </div>
              <div class="am-u-sm-8 am-u-md-8">
                <input type="text" class="am-input-sm" name="webcopy" id="webcopy" value="{:F('webSet')['webcopy']}">
              </div>
              <div class="am-hide-sm-only am-u-md-2">*必填</div>
            </div>

            <div class="am-g am-margin-top-sm">
              <div class="am-u-sm-12 am-u-md-2 am-text-right admin-form-text">
                统计代码
              </div>
              <div class="am-u-sm-8 am-u-md-8">
                <textarea id="web_count" name="web_count"  rows="10">{:F('webSet')['web_count']}</textarea>
              </div>
              <div class="am-hide-sm-only am-u-md-2"></div>
            </div>

            <div class="am-g am-margin-top-sm">
              <div class="am-u-sm-12 am-u-md-2 am-text-right admin-form-text">
                网站宠物
              </div>
              <div class="am-u-sm-8 am-u-md-8">
                <textarea id="web_pet" name="web_pet"  rows="4">{:F('webSet')['web_pet']}</textarea>
                网站宠物可以去 <a target="_blank" href="http://abowman.com/">网站一</a> 和 <a target="_blank" href="http://bunnyherolabs.com/">网站二</a> 这两个网站免费领养
              </div>
              <div class="am-hide-sm-only am-u-md-2"></div>
            </div>

            <div class="am-g am-margin-top">
              <div class="am-u-sm-4 am-u-md-2 am-text-right">
                后台登录样式
              </div>
              <div class="am-u-sm-8 am-u-md-8">
                 <div class="am-form-group">
                  <label class="am-radio-inline">
                    <input type="radio"  value="login" id="loginType" name="loginType" <?php echo F('webSet')['loginType']=='login'?'checked="checked"':'';?>> 
                    <img src="__PUBLIC__/static/admin/i/login.png" data-am-popover="{content: '<img style=\'width:700px\' src=\'__PUBLIC__/static/admin/i/login.png\'>', trigger: 'hover focus'}" width="100px">
                  </label>
                  <!--<label class="am-radio-inline">-->
                    <!--<input type="radio" value="login2" id="loginType" name="loginType" <?php echo F('webSet')['loginType']=='login2'?'checked="checked"':'';?>>-->
                    <!--<img src="__PUBLIC__/static/admin/i/login2.png" data-am-popover="{content: '<img style=\'width:700px\' src=\'__PUBLIC__/static/admin/i/login2.png\'>', trigger: 'hover focus'}" width="100px">-->
                  <!--</label>-->
                </div>
              </div>
              <div class="am-hide-sm-only am-u-md-2"></div>
            </div>

           
            <hr>
            <div class="am-g am-margin-top">
              <div class="am-u-sm-4 am-u-md-2 am-text-right">
                是否开启评论弹幕
              </div>
              <div class="am-u-sm-8 am-u-md-8">
                <div class="am-btn-group" data-am-button>
                  <label class="am-btn am-btn-default am-btn-xs <?php echo F('webSet')['barrage']==1?'am-active':'';?>">
                    <input type="radio" name="barrage" id="option1" <?php echo F('webSet')['barrage']==1?'checked="checked"':'';?> value="1"> 是
                  </label>
                  <label class="am-btn am-btn-default am-btn-xs <?php echo F('webSet')['barrage']==0?'am-active':'';?>">
                    <input type="radio" name="barrage" id="option2" <?php echo F('webSet')['barrage']==0?'checked="checked"':'';?> value="0"> 否
                  </label>
                </div>
              </div>
              <div class="am-hide-sm-only am-u-md-2"></div>
            </div>
            <div class="am-g am-margin-top">
              <div class="am-u-sm-4 am-u-md-2 am-text-right">
                是否开启动画提示
              </div>
              <div class="am-u-sm-8 am-u-md-8">
                <div class="am-btn-group" data-am-button>
                  <label class="am-btn am-btn-default am-btn-xs <?php echo F('webSet')['miku']==1?'am-active':'';?>">
                    <input type="radio" name="miku" id="option1" <?php echo F('webSet')['miku']==1?'checked="checked"':'';?> value="1"> 是
                  </label>
                  <label class="am-btn am-btn-default am-btn-xs <?php echo F('webSet')['barrage']==0?'am-active':'';?>">
                    <input type="radio" name="miku" id="option2" <?php echo F('webSet')['miku']==0?'checked="checked"':'';?> value="0"> 否
                  </label>
                </div>
              </div>
              <div class="am-hide-sm-only am-u-md-2"></div>
            </div>
            <hr>
            <div class="am-g am-margin-top">
              <div class="am-u-sm-4 am-u-md-2 am-text-right">
                是否开启qq登录
              </div>
              <div class="am-u-sm-8 am-u-md-8">
                <div class="am-btn-group" data-am-button>
                  <label onclick="showdiv(1)" class="am-btn am-btn-default am-btn-xs <?php echo F('webSet')['qqLogin']==1?'am-active':'';?>">
                    <input type="radio" name="qqLogin" id="option1" <?php echo F('webSet')['qqLogin']==1?'checked="checked"':'';?> value="1"> 是
                  </label>
                  <label onclick="hidediv(1)" class="am-btn am-btn-default am-btn-xs <?php echo F('webSet')['qqLogin']==0?'am-active':'';?>">
                    <input type="radio" name="qqLogin" id="option2" <?php echo F('webSet')['qqLogin']==0?'checked="checked"':'';?> value="0"> 否
                  </label>
                </div>
              </div>
              <div class="am-hide-sm-only am-u-md-2">*必填</div>
            </div>
            <div class="am-g am-margin-top sdafgsd_1">
              <div class="am-u-sm-4 am-u-md-2 am-text-right">
                应用ID
              </div>
              <div class="am-u-sm-8 am-u-md-8">
                <input type="text" class="am-input-sm" name="appid" id="appid" value="{:F('webSet')['appid']}">
              </div>
              <div class="am-hide-sm-only am-u-md-2">必填</div>
            </div>
            <div class="am-g am-margin-top sdafgsd_1">
              <div class="am-u-sm-4 am-u-md-2 am-text-right">
                应用密钥
              </div>
              <div class="am-u-sm-8 am-u-md-8">
                <input type="password" class="am-input-sm" name="appkey" id="appkey" value="{:F('webSet')['appkey']}">
              </div>
              <div class="am-hide-sm-only am-u-md-2">必填</div>
            </div>
            <div class="am-g am-margin-top sdafgsd_1">
              <div class="am-u-sm-4 am-u-md-2 am-text-right">
                QQ登陆回调地址
              </div>
              <div class="am-u-sm-8 am-u-md-8">
                <input type="text" class="am-input-sm" name="callback" id="callback" value="{:F('webSet')['callback']}">
              </div>
              <div class="am-hide-sm-only am-u-md-2">必填</div>
            </div>
            <hr>
            <div class="am-g am-margin-top">
              <div class="am-u-sm-4 am-u-md-2 am-text-right">
                是否开启邮件提醒
              </div>
              <div class="am-u-sm-8 am-u-md-8">
                <div class="am-btn-group" data-am-button>
                  <label onclick="showdiv(2)" class="am-btn am-btn-default am-btn-xs <?php echo F('webSet')['Semail']==1?'am-active':'';?>">
                    <input type="radio" name="Semail" id="option1" <?php echo F('webSet')['Semail']==1?'checked="checked"':'';?> value="1"> 是
                  </label>
                  <label onclick="hidediv(2)" class="am-btn am-btn-default am-btn-xs <?php echo F('webSet')['Semail']==0?'am-active':'';?>">
                    <input type="radio" name="Semail" id="option2" <?php echo F('webSet')['Semail']==0?'checked="checked"':'';?> value="0"> 否
                  </label>&nbsp;&nbsp;&nbsp;&nbsp;开启后以下都要填写
                </div>
              </div>
              <div class="am-hide-sm-only am-u-md-2">*必填</div>
            </div>
            <div class="am-g am-margin-top sdafgsd_2">
              <div class="am-u-sm-4 am-u-md-2 am-text-right">
                smtp服务器的名称
              </div>
              <div class="am-u-sm-8 am-u-md-8">
                <input type="text" class="am-input-sm" name="MAIL_HOST" id="MAIL_HOST" value="{:F('webSet')['MAIL_HOST']}">
              </div>
              <div class="am-hide-sm-only am-u-md-2">必填</div>
            </div>

            <div class="am-g am-margin-top sdafgsd_2">
              <div class="am-u-sm-4 am-u-md-2 am-text-right">
                你的邮箱名
              </div>
              <div class="am-u-sm-8 am-u-md-8">
                <input type="text" class="am-input-sm" name="MAIL_USERNAME" id="MAIL_USERNAME" value="{:F('webSet')['MAIL_USERNAME']}">
              </div>
              <div class="am-hide-sm-only am-u-md-2">必填</div>
            </div>

            <div class="am-g am-margin-top sdafgsd_2">
              <div class="am-u-sm-4 am-u-md-2 am-text-right">
                发件人地址
              </div>
              <div class="am-u-sm-8 am-u-md-8">
                <input type="text" class="am-input-sm" name="MAIL_FROM" id="MAIL_FROM" value="{:F('webSet')['MAIL_FROM']}">
              </div>
              <div class="am-hide-sm-only am-u-md-2">必填</div>
            </div>

            <div class="am-g am-margin-top sdafgsd_2">
              <div class="am-u-sm-4 am-u-md-2 am-text-right">
                发件人姓名
              </div>
              <div class="am-u-sm-8 am-u-md-8">
                <input type="text" class="am-input-sm" name="MAIL_FROMNAME" id="MAIL_FROMNAME" value="{:F('webSet')['MAIL_FROMNAME']}">
              </div>
              <div class="am-hide-sm-only am-u-md-2">必填</div>
            </div>

            <div class="am-g am-margin-top sdafgsd_2">
              <div class="am-u-sm-4 am-u-md-2 am-text-right">
                邮箱独立密码
              </div>
              <div class="am-u-sm-8 am-u-md-8">
                <input type="password" class="am-input-sm" name="MAIL_PASSWORD" id="MAIL_PASSWORD" value="{:F('webSet')['MAIL_PASSWORD']}">
              </div>
              <div class="am-hide-sm-only am-u-md-2">必填</div>
            </div>

            <hr>
            <div class="am-u-md-10 am-u-md-offset-2">
                <if condition="$_SESSION['userinfo'][0]['username'] eq 'mengfan'">
            <button type="submit" class="am-btn am-btn-primary am-btn-xs">提交保存</button>
                    <else />
                    <button type="submit" class="am-btn am-btn-primary am-btn-xs" disabled>提交保存</button>
                    </if>
            <a href="{:U('__ACTION__')}" class="am-btn am-btn-primary am-btn-xs">放弃保存</a>
          </div>
          </form>
        </div>

      </div>
    </div>

</block>

<block name="js">
<script type="text/javascript" src="__PUBLIC__/static/highlightJS/highlight.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/static/admin/colpick/colpick.js"></script>
<script src="__PUBLIC__/static/admin/tags/jquery.tagsinput.min.js"></script>
    <script>
    function updatesuch(obj){
      $("#suchas").css('font-size', $(obj).val()+'px');
    }
    function hidediv(id){
      $(".sdafgsd_"+id).hide('300', function() {
        $(".sdafgsd_"+id).each(function(index, el) {
          $(el).fadeOut(200);
        });
      });
    }
    function showdiv(id){
      $(".sdafgsd_"+id).show('300', function() {
        $(".sdafgsd_"+id).each(function(index, el) {
          $(el).fadeIn(200);
        });
      });
    }
    $(function(){
      if(<?php echo isset(F('webSet')['Semail'])?F('webSet')['Semail']:0;?>==1){
        showdiv(2);
      }else{
        hidediv(2)
      }
      if(<?php echo isset(F('webSet')['qqLogin'])?F('webSet')['qqLogin']:0;?>==1){
        showdiv(1);
      }else{
        hidediv(1)
      }
    });
    /*代码高亮显示行号*/
      $(function(){
        $('pre code').each(function(){
            var lines = $(this).text().split('\n').length - 1;
            var $numbering = $('<ul/>').addClass('pre-numbering');
            $(this)
                .addClass('has-numbering')
                .parent()
                .append($numbering);
            for(i=1;i<=lines+1;i++){
                $numbering.append($('<li/>').text(i));
            }
        });
      });
    //tags
      $('#keywords').tagsInput({width:'auto'});
    $('#picwaterfontcolor').colpick({
    // flat:true,
    layout:'hex',
    submit:0,
    onChange:function(){
      $("#picwaterfontcolor").val('#'+$(".colpick_hex_field input").val());
    }
  });


    /*代码高亮选择*/
      hljs.initHighlightingOnLoad();
      styleArr = ["solarized_dark","androidstudio","arta","ascetic","atelier-cave.dark","atelier-cave.light","atelier-dune.dark","atelier-dune.light",
      "atelier-estuary.dark","atelier-estuary.light","atelier-forest.dark","atelier-forest.light","atelier-heath.dark","atelier-heath.light",
      "atelier-lakeside.dark","atelier-lakeside.light","atelier-plateau.dark","atelier-plateau.light","atelier-savanna.dark","atelier-savanna.light",
      "atelier-seaside.dark","atelier-seaside.light","atelier-sulphurpool.dark","atelier-sulphurpool.light","brown_paper","codepen-embed",
      "color-brewer","dark","darkula","default","docco","far","foundation","github-gist","github","googlecode","grayscale","hopscotch","hybrid","idea",
      "ir_black","kimbie.dark","kimbie.light","magula","mono-blue","monokai","monokai_sublime","obsidian","paraiso.dark","paraiso.light",
      "pojoaque","railscasts","rainbow","school_book","agate","solarized_light","sunburst","tomorrow-night-blue",
      "tomorrow-night-bright","tomorrow-night-eighties","tomorrow-night","tomorrow","vs","xcode","zenburn"];  
      selectHtml = [];  
      selectHtml.push('<select id="changeStyle" name="codeStyle">');  
      var option='';
      for(i in styleArr) {  
          OptionValue = styleArr[i];  
          if("{:F('webSet')['codestyle']}"==OptionValue){
            option='<option value="' + OptionValue +'" selected="selected">'+(parseInt(i)+1)+ '：'+ OptionValue +'</option>';
          }else{
            option='<option value="' + OptionValue +'">'+(parseInt(i)+1)+ '：'+OptionValue +'</option>';
          }
          
          selectHtml.push(option);  
      }  
      selectHtml.push('</select>');  
      selectHtmlString = selectHtml.join("");  
      document.getElementById('selectHtml').innerHTML = selectHtmlString;  
        
      obj = document.getElementById('changeStyle');  
      obj.addEventListener("change",function(event){  
          var value = this.options[this.options.selectedIndex].value;      
          l = document.createElement('link');  
          l.setAttribute('href','__PUBLIC__/static/highlightJS/styles/'+value+".css");  
          l.setAttribute('rel','stylesheet');  
          document.getElementById('selectHtml').appendChild(l);  
      });  
    </script>  
      <script type="text/javascript">

        $("#setForm").submit(function () {
            layer.msg('提交中', {
                icon: 16
                ,shade: 0.01
            });
            var radio = document.getElementsByName("Semail");  
            var Semail=0;
            for (i=0; i<radio.length; i++) {  
                if (radio[i].checked) {  
                  Semail=radio[i].value;
                }  
            }
            var radio2 = document.getElementsByName("qqLogin");  
            var qqLogin=0;
            for (i=0; i<radio2.length; i++) {  
                if (radio2[i].checked) {  
                  qqLogin=radio2[i].value;
                }  
            }
            var radio3 = document.getElementsByName("barrage");  
            var barrage=0;
            for (i=0; i<radio3.length; i++) {  
                if (radio3[i].checked) {  
                  barrage=radio3[i].value;
                }  
            }
            var radio4 = document.getElementsByName("loginType");  
            var loginType='login';
            for (i=0; i<radio4.length; i++) {  
                if (radio4[i].checked) {  
                  loginType=radio4[i].value;
                } 
            }
            var radio5 = document.getElementsByName("miku");  
            var miku=0;
            for (i=0; i<radio5.length; i++) {  
                if (radio5[i].checked) {  
                  miku=radio5[i].value;
                } 
            }
            var webtitle=$("#webtitle").val();
            var keywords=$("#keywords").val();
            var web_description=$('#web_description').val();
            var codestyle=$('#changeStyle').val();
            var webcopy=$('#webcopy').val();
            var picwaterfontsize=$('#picwaterfontsize').val();
            var picwaterfontcolor=$('#picwaterfontcolor').val();
            var picwater=$('#picwater').val();
            var MAIL_HOST=$('#MAIL_HOST').val();
            var MAIL_USERNAME=$('#MAIL_USERNAME').val();
            var MAIL_FROM=$('#MAIL_FROM').val();
            var MAIL_FROMNAME=$('#MAIL_FROMNAME').val();
            var MAIL_PASSWORD=$('#MAIL_PASSWORD').val();
            var appid=$('#appid').val();
            var appkey=$('#appkey').val();
            var callback=$('#callback').val();
            var web_count=$('#web_count').val();
            var web_pet=$('#web_pet').val();
            if(webtitle=='' || keywords=='' || web_description=='' || codestyle=='' || webcopy==''){
                layer.msg('有未填写项');
            }else{
              if(Semail==1){
                if(MAIL_HOST=='' || MAIL_USERNAME=='' || MAIL_FROM=='' || MAIL_FROMNAME=='' || MAIL_PASSWORD==''){
                  layer.msg('邮件服务有未填写项');
                  return false;
                }
              }
              if(qqLogin==1){
                if(appid=='' || appkey=='' || callback==''){
                  layer.msg('QQ登陆有未填写项');
                  return false;
                }
              }
                $.post('{:U("__ACTION__")}',
                  {'webtitle':webtitle,'keywords':keywords,'web_description':web_description,'picwaterfontcolor':picwaterfontcolor,
                  'codestyle':codestyle,'webcopy':webcopy,'picwater':picwater,'picwaterfontsize':picwaterfontsize,
                  'MAIL_HOST':MAIL_HOST,'Semail':Semail,'qqLogin':qqLogin,'appid':appid,'appkey':appkey,'callback':callback,
                  'MAIL_USERNAME':MAIL_USERNAME,'MAIL_FROM':MAIL_FROM,'barrage':barrage,'web_count':web_count,'miku':miku,
                  'MAIL_FROMNAME':MAIL_FROMNAME,'MAIL_PASSWORD':MAIL_PASSWORD,'loginType':loginType,'web_pet':web_pet
                },
                   function (res) {
                    if(res.status){
                        layer.msg(res.msg);
                        deleteCache();
                    }else{
                        layer.alert(res.msg,{icon:5});
                    }
                })
            }
            return false;
        });

    </script>
</block>